import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/main/index.vue'
import Adopt from '../views/adopt/adopt.vue'
import FindPets from '../views/findPets/findPets.vue'
import FindOwenr from '../views/findOwner/findowner.vue'
import News from '../views/news/news.vue'
import Forum from '../views/forum/forum.vue'
import Shopping from '../views/shooping/shopping.vue'
import AdoptDetail from '../views/adopt/adoptDetail.vue'
import FindPetsDetail from '../views/findPets/findPetsDetail.vue'
import FindOwnerDetail from '../views/findOwner/findOwnerDetail.vue'
import NewsDetail from '../views/news/newsDetail.vue'
import PublishAdopt from '../views/adopt/publishAdopt.vue'
import PublishFindPets from '../views/findPets/publishFindPets.vue'
import PublishFindOwner from '../views/findOwner/publishFindOwner.vue'
import MyCart from '../views/userInfo/myCart.vue'
import Myorder from '../views/userInfo/myOrder.vue'
import UserInfo from '../views/userInfo/userInfo.vue'
import UserInfoUser from '../components/userInfo/userInfo.vue'
import UserInfoUpdate from '../components/userInfo/updateInfo.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        component: Main
    }, {
        path: '/adopt',
        component: Adopt
    }, {
        path: '/adopt/detail',
        component: AdoptDetail
    }, {
        path: '/adopt/publishadopt',
        component: PublishAdopt
    }, {
        path: '/findpets',
        component: FindPets
    },
    {
        path: '/findpets/detail',
        component: FindPetsDetail
    },
    {
        path: '/findpets/publishfindpets',
        component: PublishFindPets
    }, {
        path: '/findowner',
        component: FindOwenr
    },
    {
        path: '/findowner/detail',
        component: FindOwnerDetail
    }, {
        path: '/findpets/publishfindowner',
        component: PublishFindOwner
    }, {
        path: '/news',
        component: News
    }, {
        path: '/news/detail',
        component: NewsDetail
    }, {
        path: '/forum',
        component: Forum
    }, {
        path: '/shopping',
        component: Shopping
    }, {
        path: '/mycart',
        component: MyCart
    }, {
        path: '/myorder',
        component: Myorder
    }, {
        path: '/userinfo',
        component: UserInfo,
        children: [{
                path: '/userinfo',
                component: UserInfoUser
            }, {
                path: '/userinfo/user',
                component: UserInfoUser
            },
            {
                path: '/userinfo/update',
                component: UserInfoUpdate
            }
        ]
    },
]

const router = new VueRouter({
    routes
})

export default router